<?php
/**
 * Created by PhpStorm.
 * User: wo
 * Date: 2019/9/19
 * Time: 18:11
 */
class Wish_pay_logModel extends BaseModel
{
    var $table = 'wish_pay_log';
    var $prikey = 'id';
    var $_name = 'wish_pay_log';
    var $_relation  = array(
        'has_member' => array(
            'model'         => 'member',
            'type'          => BELONGS_TO,
            'foreign_key'   => 'user_id',
            'reverse' => 'user_wish_log',
        ),
    );

    //获取当前人所有的付款记录及后台帮砍金额
    function getPayLog($wish_id,$type=1){
        return $this->getOne("select sum(money) from ecm_wish_pay_log where wish_id = ".$wish_id." AND type =".$type);
    }


}